<?php
$this->headTitle($this->translate('Village table'));
$this->headScript()
    ->appendScript('
$(function(){
    $("#tableclass").mouseover(function(){
        $(this).find("a").show();
    });
    $("#tableclass").mouseout(function(){
        $(this).find("a").hide();
    });
});
');
//style
$this->headStyle('
#family{width:100%;}
#family,#family th,#family td{border:1px solid #B9CDCE;}
#family thead td{padding:5px 4px;}
#family tbody td{padding:3px 1px;}

#zend_form{
    position:relative;
}
#tabledate{
    line-height:20px;
    margin-bottom:10px;
}
#tableclass{ 
    background: none repeat scroll 0 0 #FEFEFE;
    border: 1px solid #EFEFEF;
    line-height: 20px;
    padding: 2px 10px;
    position: absolute;
    right: 0;
    width: 180px;
    z-index: 999;
}
#tableclass a{
    float:left;
    display: none;
}
');
?>


<h2>
    <span><?php echo date('Y')?>年<?php echo $this->quarter?>季度出生、节育情况报表</span>
</h2>

<dl id="zend_form">
<dt>
<div id="tableclass" class="right-bar">
    <span class="index">季度人口一般情况报表</span>
    <a href="<?php echo $this->url(array('action'=> "month"))?>">月度出生、节育情况报表</a>
    <a href="<?php echo $this->url(array('action'=> "year"))?>">年度人口和出生情况报表</a>
</div>
<div id="tabledate">
<?php echo date('Y')?> 年
<?php for ($q=1;$q<=date('m')/3;$q++): ?>
    <a href="<?php echo $this->url(array(
        'quarter' => $q
    ))?>"><?php echo $q?></a>
<?php endfor;?> 季度
</div>
</dt>
<dd>

<table id="family">
<thead>
<tr>
    <td rowspan="2">单位</td>
    <td rowspan="2">年初总人口</td>
    <td rowspan="2">期末总人口</td>
    <td colspan="20">期末选用各种避孕方法人数</td>
</tr>
<tr>
    <td>小计</td>
<?php
$totalCount = 0;
foreach ($this->total as $count) {
    $totalCount+= $count['number'];
    echo '<td>'.$count['measure'].'</td>';
} ?>
</tr>
</thead>
<tbody>
<tr>
    <td>城镇居民</td>
    <td><?php echo $this->total1?></td>
    <td><?php echo $this->total2?></td>
    <td><?php echo $totalCount?></td>
<?php
foreach ($this->total as $count) {
    echo '<td>'.$count['number'].'</td>';
} ?>
</tr>
</tbody>
</table>
</dd>
</dl>